/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package view;

import com.sun.lwuit.Form;

/**
 *
 * @author Kvest
 */
public abstract class TimeSelectForm extends Form
{
    public static final int OK_ID = 1;
    public static final int BACK_ID = 2;
    
    public TimeSelectForm(String title)
    {
        super(title);
    }
    
    public abstract String getTimeStr();
    public abstract void reset();
    
    public int getTime()
    {
        try
        {
            return Integer.parseInt(getTimeStr());
        }
        catch(Exception ex)
        {
            return 10;
        }
    }
    
    public static TimeSelectForm createTimeSelectForm(String title,String cbTitle, String backCommandName, FormAction listener)
    {
        if (ViewManager.getViewManager().getFunctionMenuType() == FunctionMenu.CHERNOVTSI_TYPE)
        {
            return new ChernovtsiTimeSelectForm(title, backCommandName, listener);
        }
        else
        {
            return new DefaultTimeSelectForm(title, cbTitle, backCommandName, listener);
        }
    }
}
